import { Component, Input, OnChanges, OnInit } from '@angular/core';

@Component({
    selector: 'itmp-plan-preview-img',
    templateUrl: './plan-preview-img.component.html',
    styleUrls: ['../../../dissemination-management/message-library/add-vms/vms-message-info/vms-message-info.component.css']
})
export class PlanPreviewImgComponent implements OnInit, OnChanges {
    @Input() previewUrls = '';
    previewList = [];
    showPage = 0;

    constructor() {}

    ngOnInit() {
        this.previewList = this.previewUrls.split(',').reverse();
    }

    ngOnChanges(change) {
        try {
            this.previewList = this.previewUrls.split(',').reverse();
        } catch (error) {}
    }

    goToPage(page) {
        this.showPage = page;
    }
}
